package com.ehouse;

import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;

import com.ehouse.models.Settings;


public class PreferencesActivity extends PreferenceActivity {
	  @SuppressWarnings("deprecation")
	@Override
	  public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    addPreferencesFromResource(R.xml.preferences);
	    
        SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
        if (!(sharedPrefs.getString(Settings.IP,"").length() > 0)){
			PreferenceScreen screen = (PreferenceScreen) findPreference("main_pref");
			// simulate a click / call it!!
			screen.onItemClick( null, null, 0, 0 ); 
		}
	  }
}
